package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenTablesInfoMapper;
import com.server.pinggu.domain.SenTablesInfo;
import com.server.pinggu.service.ISenTablesInfoService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenTablesInfoServiceImpl extends ServiceImpl<SenTablesInfoMapper, SenTablesInfo> implements ISenTablesInfoService {

    @Override
    public List<SenTablesInfo> queryList(SenTablesInfo senTablesInfo) {
        LambdaQueryWrapper<SenTablesInfo> lqw = Wrappers.lambdaQuery();
        if (senTablesInfo.getCid() != null){
            lqw.eq(SenTablesInfo::getCid ,senTablesInfo.getCid());
        }
        if (StringUtils.isNotBlank(senTablesInfo.getFd())){
            lqw.eq(SenTablesInfo::getFd ,senTablesInfo.getFd());
        }
        if (StringUtils.isNotBlank(senTablesInfo.getComment())){
            lqw.eq(SenTablesInfo::getComment ,senTablesInfo.getComment());
        }
        if (StringUtils.isNotBlank(senTablesInfo.getType())){
            lqw.eq(SenTablesInfo::getType ,senTablesInfo.getType());
        }
        if (senTablesInfo.getLeng() != null){
            lqw.eq(SenTablesInfo::getLeng ,senTablesInfo.getLeng());
        }
        if (StringUtils.isNotBlank(senTablesInfo.getOther())){
            lqw.eq(SenTablesInfo::getOther ,senTablesInfo.getOther());
        }
        return this.list(lqw);
    }
}